﻿
Partial Class loginOK
    Inherits System.Web.UI.Page

    Dim OCNSOCIOS As New Socios
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim DS As New Data.DataSet
        DS = OCNSOCIOS.Usuarios_login(Me.Txt_dni.Text, Me.TextBox1.Text)

        If DS.Tables(0).Rows.Count <> 0 Then
            If DS.Tables(0).Rows(0).Item(2) = "Admin" Then
                'MsgBox("Usuario Administrador")
                Session.Add("tipousuario", DS.Tables(0).Rows(0).Item(2))
                Response.Redirect("Default.aspx")
            Else
                If DS.Tables(0).Rows(0).Item(3) = "SI" Then
                    'MsgBox("SOCIO")
                    Session.Add("dniSocio", Me.Txt_dni.Text)
                    Session.Add("tipousuario", DS.Tables(0).Rows(0).Item(2))
                    Response.Redirect("Default.aspx")
                Else
                    MsgBox("Existe, pero falta habilitacion")
                End If
            End If
        Else
            MsgBox("Error!! verifique usuario")
        End If

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim valor As String
        valor = "invitado"
        Session.Add("tipousuario", valor)
    End Sub

End Class
